package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PxBoxItemDetailMapper;
import com.ruoyi.system.domain.PxBoxItemDetail;
import com.ruoyi.system.service.IPxBoxItemDetailService;

/**
 * 拼箱订单的详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-02
 */
@Service
public class PxBoxItemDetailServiceImpl implements IPxBoxItemDetailService 
{
    @Autowired
    private PxBoxItemDetailMapper pxBoxItemDetailMapper;

    /**
     * 查询拼箱订单的详情
     * 
     * @param boxItemDetailId 拼箱订单的详情主键
     * @return 拼箱订单的详情
     */
    @Override
    public PxBoxItemDetail selectPxBoxItemDetailByBoxItemDetailId(Long boxItemDetailId)
    {
        return pxBoxItemDetailMapper.selectPxBoxItemDetailByBoxItemDetailId(boxItemDetailId);
    }

    /**
     * 查询拼箱订单的详情列表
     * 
     * @param pxBoxItemDetail 拼箱订单的详情
     * @return 拼箱订单的详情
     */
    @Override
    public List<PxBoxItemDetail> selectPxBoxItemDetailList(PxBoxItemDetail pxBoxItemDetail)
    {
        return pxBoxItemDetailMapper.selectPxBoxItemDetailList(pxBoxItemDetail);
    }

    /**
     * 新增拼箱订单的详情
     * 
     * @param pxBoxItemDetail 拼箱订单的详情
     * @return 结果
     */
    @Override
    public int insertPxBoxItemDetail(PxBoxItemDetail pxBoxItemDetail)
    {
        pxBoxItemDetail.setCreateTime(DateUtils.getNowDate());
        return pxBoxItemDetailMapper.insertPxBoxItemDetail(pxBoxItemDetail);
    }

    /**
     * 修改拼箱订单的详情
     * 
     * @param pxBoxItemDetail 拼箱订单的详情
     * @return 结果
     */
    @Override
    public int updatePxBoxItemDetail(PxBoxItemDetail pxBoxItemDetail)
    {
        pxBoxItemDetail.setUpdateTime(DateUtils.getNowDate());
        return pxBoxItemDetailMapper.updatePxBoxItemDetail(pxBoxItemDetail);
    }

    /**
     * 批量删除拼箱订单的详情
     * 
     * @param boxItemDetailIds 需要删除的拼箱订单的详情主键
     * @return 结果
     */
    @Override
    public int deletePxBoxItemDetailByBoxItemDetailIds(Long[] boxItemDetailIds)
    {
        return pxBoxItemDetailMapper.deletePxBoxItemDetailByBoxItemDetailIds(boxItemDetailIds);
    }

    /**
     * 删除拼箱订单的详情信息
     * 
     * @param boxItemDetailId 拼箱订单的详情主键
     * @return 结果
     */
    @Override
    public int deletePxBoxItemDetailByBoxItemDetailId(Long boxItemDetailId)
    {
        return pxBoxItemDetailMapper.deletePxBoxItemDetailByBoxItemDetailId(boxItemDetailId);
    }
}
